import Caption from '~/components/text/caption'

export const meta = {
  editUrl:
    'pages/docs/integrations/integrations-docs-mdx/using-the-metadata-store/access-via-integration-utils.mdx',
  lastEdited: '2019-10-15T22:03:42.000Z'
}

## Access via @zeit/integration-utils

If you use the `@zeit/integration-utils` helper to create the UIHook, you can access the Metadata Store via the zeitClient instance, for example:

```js
const { withUiHook } = require('@zeit/integration-utils')

module.exports = withUiHook(async ({ payload, zeitClient }) => {
  // Get metadata
  const metadata = await zeitClient.getMetadata()
  metadata.count = metadata.count || 0
  metadata.count += 1

  // Set metadata
  await zeitClient.setMetadata(metadata)

  return `
    <Page>
    <P>Counter: ${metadata.count}</P>
      <Button>Count Me</Button>
    </Page>
  `
})
```

<Caption>An example UIHook using the Metadata Store.</Caption>
